class ConfManager {
  constructor () {
    this.addToState = (key, value) => (this._state[key] = value)
    this.readFromState = (key) => this._state[key]
    this._state = {}
  }
}
ConfManager.addToState = (key, value) => {
  if (!ConfManager._singleton) {
    ConfManager._singleton = new ConfManager()
  }
  ConfManager._singleton.addToState(key, value)
}
ConfManager.readFromState = (key) => {
  if (!ConfManager._singleton) {
    ConfManager._singleton = new ConfManager()
  }
  return ConfManager._singleton.readFromState(key)
}

export { ConfManager }
